<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core'%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="pardo" uri="http://pardoland.home.kg"%>
    
<link href="/awb/css/pardo.css" rel="stylesheet" type="text/css" />

  <div class="story">
  <form:form commandName="command" action="#" >
  <table width="200" border="0" cellspacing="1" cellpadding="2" >
  
  <tr>
  <td colspan="3" style="font-weight: bold;font-size: large">
	&lt;<c:out value="${param.task}"></c:out>&gt;
  </td>
  </tr>
  <tr>
  	<td colspan="3">&nbsp;</td>
  </tr>
  <c:forEach items="${view.fields}" var="field">
	<c:set var="fieldName" value="${field.name}"></c:set>
	
  	<tr>
 		<td><form:label path="${field.name}"/><c:out value="${field.label}"/></td>
  	<c:if test="${field.type == 'string'}">
  		<td><form:input path="${field.name }"/></td>
  	</c:if>
  	<c:if test="${field.type == 'textarea'}">
  		<td><form:textarea path="${field.name }"/></td>
  	</c:if>
  	<c:if test="${field.type == 'select'}">
  		<td><form:select path="${field.name }" items="${view.servicesData[field.service]}" itemLabel="label" itemValue="value"/></td>
  	</c:if>
  	<c:if test="${field.type == 'checkbox'}">
  		<td><form:checkbox path="${field.name }"/></td>
  	</c:if>
  	<c:if test="${field.type == 'radiobutton'}">
  		<td><form:radiobutton path="${field.name }"/></td>
  	</c:if>
  	<c:if test="${field.type == 'password'}">
  		<td><form:password path="${field.name }"/></td>
  	</c:if>
		<td><pardo:map key="fieldName" map="errors" ></pardo:map></td>
	
  	</tr>
  </c:forEach>
  

  <tr>
    <td colspan="2"><input name="insert" type="submit" value="Inserisci" /></td>
  </tr>
  
</table>
</form:form>
  </div>
    